package com.five.monkey.feign.es.dao.model;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author 狻猊
 * @date 2021-11-25 14:28:00
 */
@Data
@Accessors(chain = true)
@Document(indexName = "t_graph", createIndex = false)
public class Graph {

    public Graph() {
        this.id = null;
        this.title = null;
        this.status = null;
        this.userId = null;
        this.createTime = null;
        this.updateTime = null;
    }

    /**
     * 主键
     */
    @Id
    private Long id;

    /**
     * 图谱标题
     */
    @Field(name = "title", type = FieldType.Keyword, store = true)
    private String title;

    /**
     * 图谱创建者id
     */
    @Field(name = "user_id", type = FieldType.Long, store = true)
    private Long userId;

    /**
     * 图谱状态。0：正常；1：已删除
     */
    @Field(name = "status", type = FieldType.Integer, store = true)
    private Integer status;

    /**
     * 图谱创建时间
     */
    @Field(name = "create_time", type = FieldType.Keyword, store = true)
    private String createTime;

    /**
     * 图谱修改时间
     */
    @Field(name = "update_time", type = FieldType.Keyword, store = true)
    private String updateTime;
}
